package com.rzn.reading;


public class Message {
    /**
     * 消息key
     */
    private String key;
    /**
     * 消息参数
     */
    private String[] entity;

    public Message(String key, String... entity) {
        this.key = key;
        this.entity = entity;
    }

    public String getKey() {
        return key;
    }

    public void setKey(String key) {
        this.key = key;
    }

    public String[] getEntity() {
        return entity;
    }

    public void setEntity(String[] entity) {
        this.entity = entity;
    }

    /**
     * 调用消息管理器，获取拼凑成的Message后toString设置给JsonResult
     * @return 消息
     */
    @Override
    public String toString() {
        return MessageUtil.getMessage(key, entity);
    }
}
